<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="font_3702579_4ygcdyap1tu/iconfont.css">
    <title>20302120102-康明宇</title>
    <link rel="stylesheet" href="swiper-8.3.0/swiper/swiper-bundle.min.css">
    <link rel="stylesheet" href="CSS/tttj.css">
</head>
<body>
    <div id="head">
            <div class="lbt">
                <div class="swiper-wrapper">
                  <!-- JSON -->
                </div>
            </div>
    </div>

    <div id="body">
        <nav class="nav">
            <span class="cur">今日上新</span>
            <span>家电数码</span>
            <span>个护家清</span>
            <span>食品饮料</span>
        </nav>
        <div class="tabsp block">
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp1.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">12卷无芯卷纸</p>
                    <p class="fbt">爆款必囤!特价限时冲单!</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥18.4</p></p>
                    <p class="jg">卷后￥<span class="span1">1</span><span class="span2">.5</span><span class="span3">￥34.8</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp2.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">维达厨房纸巾2卷</p>
                    <p class="fbt">厨房必囤!特价限时冲单!</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥13.1</p></p>
                    <p class="jg">卷后￥<span class="span1">4</span><span class="span2">.9</span><span class="span3">￥20</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp3.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">擦鞋湿巾12片*5包</p>
                    <p class="fbt">超划算！限时特价仅3000件！</p>
                    <p><p class="ddl">58%</p></p>
                    <p><p class="zk">卷后立省￥21</p></p>
                    <p class="jg">卷后￥<span class="span1">4</span><span class="span2">.9</span><span class="span3">￥25.9</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box2">
                <p><h1>实用必囤清单</h1><h2>最高领50元优惠券</h2></p>
                <div>
                    <img src="image/tttj/tjsp.jpg" alt="">
                    <p class="bt">厨房救星</p>
                    <p class="sp">杂粮收纳盒袋9个</p>
                    <p class="jg">抢购价￥<span>7.9</span></p>
                </div>
                <div>
                    <img src="image/tttj/tjsp2.jpeg" alt="">
                    <p class="bt">历史热销</p>
                    <p class="sp">医用口罩100片</p>
                    <p class="jg">抢购价￥<span>7.9</span></p>
                </div>
                <div>
                    <img src="image/tttj/tjsp3.jpeg" alt="">
                    <p class="bt">多囤多省</p>
                    <p class="sp">平口垃圾袋200只</p>
                    <p class="jg">抢购价￥<span>6.9</span></p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp4.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">20W超级快充套餐</p>
                    <p class="fbt">快充买这个就够了！</p>
                    <p><p class="ddl">58%</p></p>
                    <p><p class="zk">卷后立省￥26.9</p></p>
                    <p class="jg">卷后￥<span class="span1">7</span><span class="span2">.9</span><span class="span3">￥34.8</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp5.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">希尔顿印花羽丝绵被</p>
                    <p class="fbt">吸湿排汗 恒温保暖</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥278</p></p>
                    <p class="jg">卷后￥<span class="span1">61</span><span class="span2"></span><span class="span3">￥399</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp6.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">只能语音小夜灯</p>
                    <p class="fbt">无需联网！2米声控距离</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥34</p></p>
                    <p class="jg">卷后￥<span class="span1">5</span><span class="span2">.9</span><span class="span3">￥39.9</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp7.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">东鹏特饮6瓶</p>
                    <p class="fbt">降价了！累了困了来一瓶！</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥22.1</p></p>
                    <p class="jg">卷后￥<span class="span1">7</span><span class="span2">.9</span><span class="span3">￥12.8</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp8.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">可折叠可伸缩手机支架</p>
                    <p class="fbt">不要再低头看手机啦！</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥6.9</p></p>
                    <p class="jg">卷后￥<span class="span1">5</span><span class="span2">.9</span><span class="span3">￥12.8</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
        </div>


        <div class="tabsp">
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp4.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">20W超级快充套餐</p>
                    <p class="fbt">快充买这个就够了！</p>
                    <p><p class="ddl">58%</p></p>
                    <p><p class="zk">卷后立省￥26.9</p></p>
                    <p class="jg">卷后￥<span class="span1">7</span><span class="span2">.9</span><span class="span3">￥34.8</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp6.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">只能语音小夜灯</p>
                    <p class="fbt">无需联网！2米声控距离</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥34</p></p>
                    <p class="jg">卷后￥<span class="span1">5</span><span class="span2">.9</span><span class="span3">￥39.9</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp8.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">可折叠可伸缩手机支架</p>
                    <p class="fbt">不要再低头看手机啦！</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥6.9</p></p>
                    <p class="jg">卷后￥<span class="span1">5</span><span class="span2">.9</span><span class="span3">￥12.8</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box2">
                <p><h1>实用必囤清单</h1><h2>最高领50元优惠券</h2></p>
                <div>
                    <img src="image/tttj/tjsp.jpg" alt="">
                    <p class="bt">厨房救星</p>
                    <p class="sp">杂粮收纳盒袋9个</p>
                    <p class="jg">抢购价￥<span>7.9</span></p>
                </div>
                <div>
                    <img src="image/tttj/tjsp2.jpeg" alt="">
                    <p class="bt">历史热销</p>
                    <p class="sp">医用口罩100片</p>
                    <p class="jg">抢购价￥<span>7.9</span></p>
                </div>
                <div>
                    <img src="image/tttj/tjsp3.jpeg" alt="">
                    <p class="bt">多囤多省</p>
                    <p class="sp">平口垃圾袋200只</p>
                    <p class="jg">抢购价￥<span>6.9</span></p>
                </div>
            </div>
         </div>

        <div class="tabsp">
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp5.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">希尔顿印花羽丝绵被</p>
                    <p class="fbt">吸湿排汗 恒温保暖</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥278</p></p>
                    <p class="jg">卷后￥<span class="span1">61</span><span class="span2"></span><span class="span3">￥399</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp1.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">12卷无芯卷纸</p>
                    <p class="fbt">爆款必囤!特价限时冲单!</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥18.4</p></p>
                    <p class="jg">卷后￥<span class="span1">1</span><span class="span2">.5</span><span class="span3">￥34.8</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp2.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">维达厨房纸巾2卷</p>
                    <p class="fbt">厨房必囤!特价限时冲单!</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥13.1</p></p>
                    <p class="jg">卷后￥<span class="span1">4</span><span class="span2">.9</span><span class="span3">￥20</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp3.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">擦鞋湿巾12片*5包</p>
                    <p class="fbt">超划算！限时特价仅3000件！</p>
                    <p><p class="ddl">58%</p></p>
                    <p><p class="zk">卷后立省￥21</p></p>
                    <p class="jg">卷后￥<span class="span1">4</span><span class="span2">.9</span><span class="span3">￥25.9</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box2">
                <p><h1>实用必囤清单</h1><h2>最高领50元优惠券</h2></p>
                <div>
                    <img src="image/tttj/tjsp.jpg" alt="">
                    <p class="bt">厨房救星</p>
                    <p class="sp">杂粮收纳盒袋9个</p>
                    <p class="jg">抢购价￥<span>7.9</span></p>
                </div>
                <div>
                    <img src="image/tttj/tjsp2.jpeg" alt="">
                    <p class="bt">历史热销</p>
                    <p class="sp">医用口罩100片</p>
                    <p class="jg">抢购价￥<span>7.9</span></p>
                </div>
                <div>
                    <img src="image/tttj/tjsp3.jpeg" alt="">
                    <p class="bt">多囤多省</p>
                    <p class="sp">平口垃圾袋200只</p>
                    <p class="jg">抢购价￥<span>6.9</span></p>
                </div>
            </div>
            
        </div>


        <div class="tabsp">
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp7.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">东鹏特饮6瓶</p>
                    <p class="fbt">降价了！累了困了来一瓶！</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥22.1</p></p>
                    <p class="jg">卷后￥<span class="span1">7</span><span class="span2">.9</span><span class="span3">￥12.8</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box2">
                <p><h1>实用必囤清单</h1><h2>最高领50元优惠券</h2></p>
                <div>
                    <img src="image/tttj/tjsp.jpg" alt="">
                    <p class="bt">厨房救星</p>
                    <p class="sp">杂粮收纳盒袋9个</p>
                    <p class="jg">抢购价￥<span>7.9</span></p>
                </div>
                <div>
                    <img src="image/tttj/tjsp2.jpeg" alt="">
                    <p class="bt">历史热销</p>
                    <p class="sp">医用口罩100片</p>
                    <p class="jg">抢购价￥<span>7.9</span></p>
                </div>
                <div>
                    <img src="image/tttj/tjsp3.jpeg" alt="">
                    <p class="bt">多囤多省</p>
                    <p class="sp">平口垃圾袋200只</p>
                    <p class="jg">抢购价￥<span>6.9</span></p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp9.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">舒可哒 火山石烤肠原味黑胡椒味肉肠地道肠热狗香肠烧烤肠</p>
                    <p class="fbt">商品抢购中</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥7.32</p></p>
                    <p class="jg">卷后￥<span class="span1">4</span><span class="span2">.5</span><span class="span3">￥12.8</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp10.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">零趣 千丝绿豆饼500g 整箱 早餐糕点心休闲零食小吃</p>
                    <p class="fbt">商品抢购中</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥15</p></p>
                    <p class="jg">卷后￥<span class="span1">4</span><span class="span2">.9</span><span class="span3">￥12.8</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
            <div class="box">
                <div class="img">
                    <img src="image/tttj/tttjsp11.png" alt="">
                </div>
                <div class="xx">
                    <p class="bt">小赞坚果列巴吐司400g整箱面包全麦早餐热量脂肪新疆俄罗斯风味低糖0蔗糖</p>
                    <p class="fbt">商品抢购中</p>
                    <p><p class="ddl">加单中</p></p>
                    <p><p class="zk">卷后立省￥7.32</p></p>
                    <p class="jg">卷后￥<span class="span1">4</span><span class="span2">.5</span><span class="span3">￥12.8</span></p>
                    <p class="msq">马上抢</p>
                </div>
            </div>
        </div>
    </div>
        
        

    <script src="swiper-8.3.0/swiper/swiper-bundle.min.js"></script>

    <script>

      var body = document.getElementById("body");
      var nav = body.getElementsByClassName("nav")[0];
      var span = nav.getElementsByTagName("span");
      var tabsp = body.querySelectorAll(".tabsp");
    
      for(var i=0; i<span.length;i++){
            span[i].index = i;

            span[i].onclick = function(){
            //让所有span去除cur类，所有的box都隐藏
            for(var j=0; j<span.length; j++){
                span[j].classList.remove("cur");
                
                tabsp[j].classList.remove("show");
            }

            this.classList.add("cur");
            tabsp[this.index].classList.add("show");
        }
      }
        
     var swiper = new Swiper(".lbt", {
          slidesPerView: 3,
          spaceBetween: 30,
          pagination: {
            el: ".swiper-pagination",
            clickable: true,
          },
          autoplay:{
            disableOnInteraction:false,
            delay:3000,
        },
        });

        var xhr = new XMLHttpRequest();
        xhr.open("get", "/JSON/tttj.json", true);
        xhr.send();
        xhr.onreadystatechange = function () {
        if (xhr.readyState == 4 && xhr.status == 200) {
          var data = JSON.parse(xhr.responseText);
          // 2.渲染数据
          var str = "";
          for (var i = 0; i < data.length; i++) {
            str += `
            <div class="swiper-slide">
                    <div class="tp">
                        <img src="${data[i].img}" alt="">
                        <h6>${data[i].sp}</h6>
                        <p><span>卷后价</span><span class="jg">￥${data[i].jg}</span></p>
                    </div>
                  </div>
            `;
          }
          document.querySelector(".swiper-wrapper").innerHTML += str;
        }
      };
      </script>
</body>
</html>